package pe.gob.sunarp.entidad;

import java.io.Serializable;
import javax.persistence.*;

/**
 * The primary key class for the SETUP database table.
 * 
 */
@Embeddable
public class SetupPK implements Serializable {
	//default serial version id, required for serializable classes.
	private static final long serialVersionUID = 1L;
	private String schemaclass;
	private String setupcode;

    public SetupPK() {
    }

	@Column(unique=true, nullable=false, length=128)
	public String getSchemaclass() {
		return this.schemaclass;
	}
	public void setSchemaclass(String schemaclass) {
		this.schemaclass = schemaclass;
	}

	@Column(unique=true, nullable=false, length=30)
	public String getSetupcode() {
		return this.setupcode;
	}
	public void setSetupcode(String setupcode) {
		this.setupcode = setupcode;
	}

	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		if (!(other instanceof SetupPK)) {
			return false;
		}
		SetupPK castOther = (SetupPK)other;
		return 
			this.schemaclass.equals(castOther.schemaclass)
			&& this.setupcode.equals(castOther.setupcode);

    }
    
	public int hashCode() {
		final int prime = 31;
		int hash = 17;
		hash = hash * prime + this.schemaclass.hashCode();
		hash = hash * prime + this.setupcode.hashCode();
		
		return hash;
    }
}